Repository navigation
Grid3DView's Strata calls covered by tests against a fake binding - #81
Merged
Merged
Conversation
grid3d/view.py was 37% covered: everything past loadStrata's first two checks only ran in the render tests, which skip wherever Strata can't load (including CI). The view is now driven against a fake `strata` module, so opening, loading, drawing a Scene, events, resize and close are exercised on every run. view.py coverage goes from 37% to 100%. Tests only; no production code changed. drafted by Claude on behalf of Daniel Stephenson Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Member
Author
|
Self-review rubric (single intrinsic pass, anchored on local pytest and CI):
Judgment notes (not blocking):
The change is ready to merge: tests only, CI green, and no do-not-auto-merge path touched. This review comment was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener). drafted by Claude on behalf of Daniel Stephenson |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stage B (unit-test expansion) cycle, targeting
grid3d/view.py, the least-covered module in the package.grid3d/view.pywas at 37% line coverage. Everything pastloadStrata's first two checks was reached only by the two render tests, which skip wherever the Strata library cannot load. That includes CI, so in practiceopen,drawScene,pollEvents,resize,savePngandclosewere never run.stratamodule (a recordingFakeEngine, plus the constants and record constructorsview.pyuses) is installed throughmonkeypatch.setitem(sys.modules, ...). With it, 13 new tests drive the realGrid3DViewcode with no GPU:loadStrata: the pinnedload_release(STRATA_VERSION);STRATA_LIBRARYchoosingload()on any platform; a load failure wrapped asUnavailablewith its reasonopen: the windowed versus headless surface and title, the sun lighting setup, and an engine constructor failure wrapped asUnavailablesetBoard()-first guards onsetPieces,sceneandcamera, pluspickCellreturningNonewithout a boardframe/drawScene: the engine call order, the camera aspect, point-light shadow flags, panels and labels (UTF-8 text), skipping empty panels, labels and camera,present=False, and a scene over the engine limits being refused before any engine callpollEventsdraining the queue,resize,savePng, and a secondclosedoing nothingview.pycoverage goes from 37% to 100%. Total coverage goes from 90% to about 97%.Test plan
SDL_VIDEODRIVER=dummy python3 -m pytest: 303 passed, 2 skipped (the two Strata render tests, as onmain). The baseline was 291 passed.pytest --cov=preponderous.graphik.grid3d.view: 100%GALLIUM_DRIVER,SDL_VIDEODRIVER,STRATA_LIBRARY), plussys.platformandsys.modules['strata'], is set throughmonkeypatch, so each one is restored after the testTestworkflow greenDeferred issues
All six open issues were skipped this cycle:
.github/workflows/, which is excluded from autonomous change.No tracking issue: the coverage gap was found during triage.
This PR description was drafted during a Gardener session (https://github.com/Stephenson-Software/gardener).
🤖 Generated with Claude Code
drafted by Claude on behalf of Daniel Stephenson